package cn.meye11.crm.controller;

import jakarta.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统首页Controller
 *
 * @author genkai
 *
 */
@Controller
public class IndexController {

    @RequestMapping("/")
    public String index() {
        return "login";
    }

    /**
     * 首页
     *
     * @return
     */
    @GetMapping(value = "index")
    public String index(Model model, HttpSession httpSession) {
        model.addAttribute("user", httpSession.getAttribute("user"));
        return "index";
    }

    @RequestMapping("/login")
    public String login(){
        return "login";
    }

    @RequestMapping("/login2")
    public String login2(String name,String password){
        /*   User user = new User(name,password);*/
        return "login2";
    }

}